var currslid = 0;
var slidint;
function setfoc(id){
	if(isNaN(id)){
		id=id.match(/(\d+)/)[0];
	}
	document.getElementById("focpic").src = picarry[id];
	document.getElementById("foclnk").href = lnkarry[id];
	document.getElementById("foctitle").innerHTML = ttlarry[id];
	currslid = id;
	for(i=0;i<picarry.length;i++){
		document.getElementById("tmb"+i).className = "thumb_off";
	};
	document.getElementById("tmb"+id).className ="thumb_on";
	
	if((!!window.ActiveXObject)&&!(!window.XMLHttpRequest)){//为IE浏览器，但非IE6
		focpic.style.visibility = "hidden";
		focpic.filters[0].Apply();
		if (focpic.style.visibility == "visible") {
			focpic.style.visibility = "hidden";
			focpic.filters.revealTrans.transition=23;
		}
		else {
			focpic.style.visibility = "visible";
			focpic.filters[0].transition=23;
		}
		focpic.filters[0].Play();
	}
	stopit();
}

function playnext(){
	currslid++;
	if(currslid==picarry.length){
		currslid = 0;
	}
	setfoc(currslid);
	playit();
}

function playit(){
	slidint = setTimeout(playnext,4500);
}

function stopit(){
	clearTimeout(slidint);
}

window.onload = function(){
	playit();
}